package com.bafa.front.presentationbeans.playerhistory;

import java.util.TreeSet;

import com.bafa.front.presentationbeans.MatchBean;
import com.bafa.objects.Match;
import com.bafa.objects.player.Player;
import com.bafa.objects.player.PlayerTeam;
import com.bafa.services.RetrieveServices;

public class TeamListGoalsBean {
	private TreeSet teams = new TreeSet();

	public TreeSet getTeams() {
		return teams;
	}

	public void setTeams(TreeSet matches) {
		this.teams = matches;
	}
	
	
	public TeamListGoalsBean(String name){
		Player player = RetrieveServices.getPlayer(name);
		PlayerTeam[] players = (PlayerTeam[])player.getTeamGoals().values().toArray(new PlayerTeam[player.getTeamGoals().values().size()]);
		for(int i=0;i<players.length;i++){
			this.teams.add(new TeamGoalsBean(players[i]));
		}
	}
	
	public TeamGoalsBean[] teams(){
		return (TeamGoalsBean[])teams.toArray(new TeamGoalsBean[teams.size()]);
	}
}
